﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vds2465Telegrams
{
    public enum eReportSubType_State
    {
        General,
        SecurityArea,
        InternalArea,
        RevisionState,
        DayMode,
    }

    public class ReportType_State : ReportType_Base
    {
        #region private member variables

        private eReportSubType_State _reportSubTypeState;

        #endregion private member variables

        #region constructor

        public ReportType_State(bool onOffFlag, eReportSubType_State reportSubTypeState)
            : base(onOffFlag)
        {
            _reportSubTypeState = reportSubTypeState;
        }

        #endregion constructor

        #region getters

        public eReportSubType_State ReportSubType { get { return _reportSubTypeState; } }

        #endregion getters

        #region ToString, Equals, GetHashCode

        public override int GetHashCode()
        {
            int hashCode = base.GetHashCode();
            hashCode ^= (byte)ReportSubType;

            return hashCode;
        }

        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("(");
            stringBuilder.Append(ToStringProperties());
            stringBuilder.Append(")");

            return stringBuilder.ToString();
        }

        internal override string ToStringProperties()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.ToStringProperties());

            stringBuilder.Append(", ");

            stringBuilder.Append("ReportSubType='");
            stringBuilder.Append(ReportSubType);
            stringBuilder.Append("'");

            return stringBuilder.ToString();
        }

        public override bool Equals(object obj)
        {
            Type objType = obj.GetType();
            if (this.GetType() == objType)
            {
                ReportType_State reportTypeState2Compare = obj as ReportType_State;
                return EqualsProperties(reportTypeState2Compare);
            }

            return false;
        }

        internal bool EqualsProperties(ReportType_State reportTypeState2Compare)
        {
            if (base.EqualsProperties(reportTypeState2Compare))
            {
                return (ReportSubType == reportTypeState2Compare.ReportSubType);
            }

            return false;
        }

        #endregion ToString, Equals, GetHashCode
    }    
}
